package cn.itcast.api;

import cn.itcast.entity.Student;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@SuppressWarnings("all")
@Api(value = "Hello Controller swagger测试", description = "Hello Controller 接口测试文档", tags = "Hello Controller 接口测试文档 --tags")
public interface HelloControllerApi {

    @PutMapping("{id}")
    @ApiOperation("测试 restFu、queryString、requestBody 方法")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "学员id", required = true, dataType = "String", paramType = "String"),
            @ApiImplicitParam(name = "name", value = "学员姓名", required = true, dataType = "String", paramType = "String")

    })
    Student mofidyStudentBynNum(@PathVariable("id") String id, @RequestParam("name") String name, @RequestBody Student student);

    @GetMapping("hello")
    @ApiOperation("测试无参方法")
    String hello();

    @GetMapping
    @ApiOperation("测试 queryString 方法")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "num", value = "传递一个数值", required = true, dataType = "String", paramType = "String")
    })
    Student modifyStudentNum(@RequestParam("num") String num);

    @GetMapping("{name}")
    @ApiOperation("测试 RestFu风格 方法")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "传递一个姓名", required = true, dataType = "String", paramType = "String")
    })
    Student modifyStudentName(@PathVariable("name") String name);

    @PostMapping
    @ApiOperation("测试 RequestBody 方法")
    Student modifyStudent(@RequestBody Student student);
}
